class price_timekey:
    def __init__(self):
        self.all=[]
        self.mkcode={}
        self.objs={}
    def ontick_timekeyback(self,obj,mkcode,timekey):
        if self.all:
            if timekey<self.all[0]:
                self.all[1]=self.all[1]+1
            self.all[0]=timekey
        else:
            self.all=[timekey,0]
        if mkcode in self.mkcode.keys():
            all=self.mkcode[mkcode]
            if timekey < all[0]:
                all[1] = all[1] + 1
            all[0] = timekey
        else:
            self.mkcode[mkcode] = [timekey, 0]
        if obj in self.objs.keys():
            all=self.objs[obj]
            if timekey < all[0]:
                all[1] = all[1] + 1
                print(obj,timekey,all[0])
            all[0] = timekey
        else:
            self.objs[obj] = [timekey, 0]
    def get_info(self):
        r={"all":0,"mkcode":0,"obj":0}
        if self.all:
            if self.all[1]>0:
                r["all"]=self.all[1]
        for k,v in self.mkcode.items():
            if v[1]>0:
                r["mkcode"]+=1
        for k,v in self.objs.items():
            if v[1]>0:
                r["obj"] += 1
        return r